import { Types, defineComponent, defineQuery } from '$lib/ecs';
import { coordPlusQuery } from './pos2';

const STRING_SIZE = 32;

export const Glyph = defineComponent('Glyph', {
  glyph: [Types.ui8, 1],
  color: [Types.ui8, 20],
  background: [Types.ui8, 20],
});
export const Description = defineComponent('Description', {
  summary: [Types.ui8, STRING_SIZE],
  description: [Types.ui8, STRING_SIZE],
});
export const Name = defineComponent('Name', {
  name: [Types.ui8, STRING_SIZE]
});
export const Interesting = defineComponent('Interesting', {});

export const Size = defineComponent('Size', {
  size: Types.ui32,
});

export const Cover = defineComponent('Cover', {
  /// Size of creatures that are hidden under this cover
  size: Types.ui32,
});


export const Opaque = defineComponent('Opaque', {});
export const Feature = defineComponent('Feature', {});
export const Creature = defineComponent('Creature', {});
export const AI = defineComponent('AI', {});
export const Null = defineComponent('Null', {});
export const Collision = defineComponent('Collision', {});
export const Impassable = defineComponent('Impassable', {});
export const Immobile = defineComponent('Immobile', {});

export const nullQuery = defineQuery([Null]);
export const collisionQuery = coordPlusQuery([Collision]);
